<template>
  <Modal v-model="cancelExtensionPop" width="30" :closable="false" :mask-closable="false"
    class-name="vertical-center-modal">
    <div slot="header" class="pop-head">
      <div class="pop-tit">{{ $t('wayBill.cancel_pop_text') }}</div>
      <Icon type="md-close" size="26" color="#242424" class="close" @click="cancelMet()" />
    </div>
    <div class="content-sty">{{ $t('wayBill.sure_tip_text') }}</div>
    <div slot="footer" class="pop-footer">
      <div></div>
      <div class="handle-sty">
        <div class="handle-btn" @click="cancelMet()">{{ $t('pay.cancel') }}</div>
        <div class="handle-btn confirm-btn" @click="confirmMet()">{{ $t('pay.ok_txt1') }}</div>
      </div>
    </div>
  </Modal>
</template>
<script>
import { mapState } from "vuex";
import { cancelExtendOrder } from "@/api/expressOrder";
export default {
  data() {
    return {
      cancelExtensionPop: false,
      form: {}
    }
  },
  computed: {
    ...mapState({
      userCurrency: state => state.user.userCurrency
    })
  },
  methods: {
    open(seItem) {
      this.form.storageOrderId = seItem.id;
      this.cancelExtensionPop = true;
    },
    cancelMet() {
      this.cancelExtensionPop = false;
    },
    confirmMet() {
      cancelExtendOrder(this.form).then((res) => {
        if (res.code == 200) {
          this.cancelMet();
          this.$Message.success(res.result);
          this.$emit('changeDate');
        }
      })
    }
  }
}
</script>

<style lang="less" scoped>
:deep(.ivu-modal-content) {
  border-radius: 12px;

  .ivu-modal-header {
    border: none;
    padding: 0;
  }

  .ivu-modal-body {
    padding: 0 32px;
  }

  .ivu-modal-footer {
    border: none;
    padding: 32px;
  }
}

.vertical-center-modal {
  display: flex;
  align-items: center;
  justify-content: center;


  .pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 32px;
    padding: 32px 0 24px 0;

    .pop-tit {
      font-family: PingFang SC, PingFang SC;
      font-weight: 600;
      font-size: 24px;
      color: #1E1714;
      line-height: 28px;
    }

    .close {
      cursor: pointer;
    }
  }

  .content-sty {
    font-weight: 500;
    font-size: 20px;
    color: #767B93;
    line-height: 23px;
  }

  .pop-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    .handle-sty {
      display: flex;
      align-items: center;
      gap: 24px;

      .handle-btn {
        min-width: 112px;
        padding: 12px 16px;
        border-radius: 8px 8px 8px 8px;
        border: 1px solid #E5E5E5;
        font-weight: 600;
        font-size: 16px;
        color: #1E1714;
        line-height: 19px;
        text-align: center;
        cursor: pointer;
      }

      .confirm-btn {
        background-color: #FF186B;
        color: #FFFFFF;
      }
    }
  }
}
</style>
